﻿using System.Web.Mvc;

namespace BlogLite.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_Error", // Route name
                "Admin/Error", // URL with parameters
                new { controller = "ControlPanel", action = "Error" }
            );

            context.MapRoute(
                "Admin_Error404", // Route name
                "Admin/Error404", // URL with parameters
                new { controller = "ControlPanel", action = "Error404" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
